package fr.idak.spring.tiles.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import fr.idak.spring.tiles.web.controller.Constante.URL;
import fr.idak.spring.tiles.web.controller.Constante.VIEW;

@Controller
@RequestMapping(URL.LOGIN_PATH)
public class LoginController {

    @RequestMapping(value = URL.LOGIN, method = {RequestMethod.GET})
    public String loginForm() {
        return VIEW.LOGIN;
    }

    
    @RequestMapping(value= URL.LOGIN_FAILED, method = {RequestMethod.GET})
    public String authenticate(ModelMap model) {
    	model.addAttribute("error", "true");
    	return VIEW.LOGIN;
    }
    
}
